package com.ardf.service;

import com.ardf.entity.Result;
import com.ardf.entity.dto.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author ShiYunHao
 * @since 2025-01-06
 */
public interface IResultService extends IService<Result> {
    /**
     * 获取结果菜单
     */
    List<ResultMenuDto> getResultMenu(Long ruleId);

    /**
     * 分页查询个人赛成绩信息
     */
    Page<GradeInfoPersonTableDto> searchInfoPersonAll(Integer pageNum, Integer pageSize, Long projectId, Long groupId, String searchAll);

    /**
     * 计算成绩
     */
    void calculateResult(Long algorithmId, Long ruleId);
    /**
     * 分页查询个人赛结果
     */
    Page<GradeResultPersonTableDto> searchResultPersonAll(Integer pageNum, Integer pageSize, String searchAll, Long projectId, Long groupId, Long algorithmId);
    /**
     * 删除
     */
    void deleteByAlgorithmId(Long algorithmId);
    /**
     * 下载表格
     */
    void downloadResultTable(HttpServletResponse response, Long algorithmId, Long projectId, Long groupId, Boolean isRelay) throws IOException;
    /**
     * 分页查询接力赛成绩信息
     */
    Page<GradeInfoRelayTableDto> searchInfoRelayAll(Integer pageNum, Integer pageSize, Long projectId, Long groupId, String searchAll);
    /**
     * 分页查询接力赛结果
     */
    Page<GradeResultRelayTableDto> searchResultRelayAll(Integer pageNum, Integer pageSize, String searchAll, Long projectId, Long groupId, Long algorithmId);
    /**
     * 上传图片
     */
    String uploadPicture(MultipartFile file, Long gradeId) throws IOException;

    /**
     * author:容伟洪
     * time:2025-3-25
     * description：按成绩id查找所有的算法id
     */

    List<Long> selectByGradeId(Long gradeId);


}
